const {
    override,
    disableEsLint,
    addWebpackAlias,

} = require("customize-cra");

// nodejs 讲过, 该模块用来操作文件路径的
const path = require("path");

module.exports = override(
    // enable legacy decorators babel plugin
    // addDecoratorsLegacy(),

    // disable eslint in webpack 在webpack 中禁用 eslist 语法检测
    disableEsLint(),

    // add webpack bundle visualizer if BUNDLE_VISUALIZE flag is enabled
    // process.env.BUNDLE_VISUALIZE == 1 && addBundleVisualizer(),

    // add an alias for "ag-grid-react" imports
    // 配置@路径别名
    addWebpackAlias({
        ["@"]: path.resolve(__dirname, "src")  // relovle 方法用于路径拼接, 返回一个绝对路径
    }),

    // adjust the underlying workbox
    // adjustWorkbox(wb =>
    //     Object.assign(wb, {
    //         skipWaiting: true,
    //         exclude: (wb.exclude || []).concat("index.html")
    //     })
    // )
);